package com.cll.prototype.sharding.jdbc.keygen;

import org.apache.shardingsphere.spi.keygen.ShardingKeyGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Properties;

/**
 * 描述信息:
 * 基于redis实现分布式主键生成
 * @author CLL
 * @version 1.0
 * @date 2020/11/22 10:39
 */
public class RedisKeyGenerator implements ShardingKeyGenerator {

    private static final Logger logger = LoggerFactory.getLogger(RedisKeyGenerator.class);

    @Override
    public Comparable<?> generateKey() {
        logger.info("===>>> 使用自定义的基于Redis的分布式主键生成器");
        return null;
    }

    @Override
    public String getType() {
        return "REDIS";
    }

    @Override
    public Properties getProperties() {
        return null;
    }

    @Override
    public void setProperties(Properties properties) {

    }
}